package com.cfpl.project_common.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 肥料信息表
 * @TableName fertilizer
 */
@TableName(value ="fertilizer")
@Data
public class Fertilizer implements Serializable {
    /**
     * 肥料编号
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 肥料名称
     */
    private String fertilizerName;

    /**
     * 肥料种类
     */
    private String fertilizerType;

    /**
     * 肥料库存
     */
    private Integer fertilizerStock;

    /**
     * 肥效期/天
     */
    private Integer fertilizerExpire;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Fertilizer other = (Fertilizer) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getFertilizerName() == null ? other.getFertilizerName() == null : this.getFertilizerName().equals(other.getFertilizerName()))
            && (this.getFertilizerType() == null ? other.getFertilizerType() == null : this.getFertilizerType().equals(other.getFertilizerType()))
            && (this.getFertilizerStock() == null ? other.getFertilizerStock() == null : this.getFertilizerStock().equals(other.getFertilizerStock()))
            && (this.getFertilizerExpire() == null ? other.getFertilizerExpire() == null : this.getFertilizerExpire().equals(other.getFertilizerExpire()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getFertilizerName() == null) ? 0 : getFertilizerName().hashCode());
        result = prime * result + ((getFertilizerType() == null) ? 0 : getFertilizerType().hashCode());
        result = prime * result + ((getFertilizerStock() == null) ? 0 : getFertilizerStock().hashCode());
        result = prime * result + ((getFertilizerExpire() == null) ? 0 : getFertilizerExpire().hashCode());
        return result;
    }


}